$(function(){

    var male = $('.male'),maleIcon = $('.male-icon'),maleBg = $('.male-bg');
    var rotate_angle = 0;
    var sex_count = 2;
    $(male).rotate({
        bind: {
            click: function() {
                rotate_angle += 180;
                sex_count++;
                $(this).rotate({animateTo: rotate_angle});

                if(sex_count%2 == 0){
                    $('.male-icon-male').rotate({animateTo:0});
                    $('.male-icon-male').hide().siblings('.male-bg-male').hide();
                    $('.male-icon-female').show().siblings('.male-bg-female').show();
                    $('.male-icon-female').rotate({animateTo:0});

                    result[45] = 'male';
                }else{
                    $('.male-icon-female').rotate({animateTo:-90});
                    $('.male-icon-female').hide().siblings('.male-bg-female').hide();
                    $('.male-icon-male').show().siblings('.male-bg-male').show();
                    $('.male-icon-male').rotate({animateTo:90});


                    result[45] = 'female';

                };

            }
        }
    });

    $('.step-a').click(function () {

       result.start = getNowFormatDate();

    });

});